package string;

/**
 * StringBuilder类:
 * 四种方法:
 * ---append():追加内容
 * ---delete():删除部分内容
 * ---replace():修改部分内容
 * ---insert():插入内容
 */
public class StringBuilderTest01 {
    public static void main(String[] args) {
        String str = "StringBuilder的四种方法";
        StringBuilder builder = new StringBuilder(str);
        builder.append(",练习一下");
        System.out.println(builder);

        builder.replace(14,18,"四种常用方法");
        System.out.println(builder);

        builder.delete(6,13);
        System.out.println(builder);

        builder.insert(0,"这是");
        System.out.println(builder);
    }

}
